Skip to content

Fix missing copyright year updates and add skill checklist reminders#2982

Open
Copilot wants to merge 6 commits intomainfrom
copilot/implement-bucket-tagging
Open

Fix missing copyright year updates and add skill checklist reminders#2982
Copilot wants to merge 6 commits intomainfrom
copilot/implement-bucket-tagging

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

The initial bucket tagging implementation left four modified test files with stale 2017-2025 copyright headers. The root cause: the implement, test, and refactor skill checklists had no explicit step for updating copyright years, so agents working through those checklists would miss the requirement even though it exists in AGENTS.md.

Changes

  • Copyright headers — bumped 2017-20252017-2026 in four test files modified by the bucket tagging implementation:

    • BucketControllerTest.kt
    • BucketServiceTest.kt
    • BucketStoreTest.kt
    • BucketMetadataTest.kt
  • Skill checklists — added an explicit copyright year update step to the ## Checklist section of all three code-touching skills:

    • .claude/skills/implement/SKILL.md
    • .claude/skills/test/SKILL.md
    • .claude/skills/refactor/SKILL.md

The new checklist item reads:

- [ ] **Update the copyright year** to the current year in the license header of every file you modify

This makes the requirement actionable at the point of use rather than relying on agents recalling the AGENTS.md DO section.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 26, 2026 17:03
…tTagging, DeleteBucketTagging)

Co-authored-by: afranken <763000+afranken@users.noreply.github.com>
…ketStore

Co-authored-by: afranken <763000+afranken@users.noreply.github.com>
Copilot AI changed the title [WIP] Add bucket tagging operations Implement bucket tagging operations Feb 26, 2026
… implemented in README

Co-authored-by: afranken <763000+afranken@users.noreply.github.com>
Copilot AI changed the title Implement bucket tagging operations Implement bucket tagging operations (GetBucketTagging, PutBucketTagging, DeleteBucketTagging) Feb 26, 2026
@afranken afranken marked this pull request as ready for review February 26, 2026 22:04
@afranken afranken self-requested a review as a code owner February 26, 2026 22:04
Copilot AI review requested due to automatic review settings February 26, 2026 22:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds missing bucket-level tagging support to S3Mock, aligning bucket APIs with the already-supported object tagging operations and exposing the corresponding AWS S3 endpoints.

Changes:

  • Persist bucket tagging in BucketMetadata and add BucketStore.storeBucketTagging() to write it to disk.
  • Add BucketService + BucketController support for GetBucketTagging, PutBucketTagging, and DeleteBucketTagging (including routing exclusions to avoid Spring MVC ambiguity).
  • Add unit/integration test coverage and update README/CHANGELOG to document the newly supported operations.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
server/src/test/resources/com/adobe/testing/s3mock/store/BucketMetadataTest_testSerialization.json Updates expected serialized bucket metadata JSON to include nullable tagging.
server/src/test/kotlin/com/adobe/testing/s3mock/store/BucketStoreTest.kt Adds store-level test verifying bucket tagging persistence and clearing.
server/src/test/kotlin/com/adobe/testing/s3mock/service/BucketServiceTest.kt Adds service-level tests for set/get/delete bucket tagging and updates metadata helper for new field.
server/src/test/kotlin/com/adobe/testing/s3mock/controller/BucketControllerTest.kt Adds controller tests for GET/PUT/DELETE ?tagging bucket endpoints.
server/src/main/kotlin/com/adobe/testing/s3mock/store/BucketStore.kt Adds storeBucketTagging() method to persist tagging in metadata.
server/src/main/kotlin/com/adobe/testing/s3mock/store/BucketMetadata.kt Adds nullable tagging: List<Tag>? field and withTagging() copy helper.
server/src/main/kotlin/com/adobe/testing/s3mock/service/BucketService.kt Implements bucket tagging operations in the service layer.
server/src/main/kotlin/com/adobe/testing/s3mock/controller/BucketController.kt Adds bucket tagging routes and NOT_TAGGING exclusions to avoid request mapping ambiguity.
integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/BucketTaggingIT.kt Adds AWS SDK v2 integration tests for bucket tagging lifecycle.
README.md Marks bucket tagging operations as supported in the operations table.
CHANGELOG.md Documents bucket tagging feature addition under 5.0.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +201 to +204
bucketStore.storeBucketTagging(bucketMetadata, tagging.tagSet.tags)
}

/**
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setBucketTagging() persists incoming tags without validating them (e.g., max tag count, duplicate keys, disallowed aws: prefix, key/value length/charset). Object tagging already enforces these constraints via ObjectService.verifyObjectTags() and throws S3Exception.INVALID_TAG; bucket tagging should apply the same rules to match S3 behavior and keep bucket/object tagging consistent (and add/adjust unit tests accordingly).

Suggested change
bucketStore.storeBucketTagging(bucketMetadata, tagging.tagSet.tags)
}
/**
val tags = tagging.tagSet.tags
verifyBucketTags(tags)
bucketStore.storeBucketTagging(bucketMetadata, tags)
}
/**
* Validates bucket tags to match S3 constraints and object-tagging behavior.
* Throws [S3Exception.INVALID_TAG] if any constraint is violated.
*/
private fun verifyBucketTags(tags: List<Tag>) {
// S3 allows up to 50 tags per resource.
if (tags.size > 50) {
throw S3Exception.INVALID_TAG
}
val seenKeys = HashSet<String>()
for (tag in tags) {
val key = tag.key
val value = tag.value
// Key must be 1–128 characters.
if (key.isEmpty() || key.length > 128) {
throw S3Exception.INVALID_TAG
}
// Key must not start with the reserved "aws:" prefix (case-insensitive).
if (key.startsWith("aws:", ignoreCase = true)) {
throw S3Exception.INVALID_TAG
}
// Keys must be unique within the tag set.
if (!seenKeys.add(key)) {
throw S3Exception.INVALID_TAG
}
// Value must be at most 256 characters.
if (value.length > 256) {
throw S3Exception.INVALID_TAG
}
// Disallow ISO control characters in keys or values.
if (key.any { Character.isISOControl(it) } ||
value.any { Character.isISOControl(it) }
) {
throw S3Exception.INVALID_TAG
}
}
}
/**

Copilot uses AI. Check for mistakes.
Co-authored-by: afranken <763000+afranken@users.noreply.github.com>
Copilot AI changed the title Implement bucket tagging operations (GetBucketTagging, PutBucketTagging, DeleteBucketTagging) Fix missing README updates and stale copyright years from bucket tagging implementation Feb 26, 2026
… skill checklists

Co-authored-by: afranken <763000+afranken@users.noreply.github.com>
Copilot AI changed the title Fix missing README updates and stale copyright years from bucket tagging implementation Fix missing copyright year updates and add skill checklist reminders Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants